<?php
require_once "Common/database.php";
require_once "Common/values.php";
echo '<p><h3>Solutions Search<p></h3>';



$result =mysql_query("SELECT * FROM tblSolutions WHERE Solution LIKE '$_POST[s]' AND LogNumber LIKE '$_POST[lognumber]' AND Operator LIKE '$_POST[operator]' AND `Date` LIKE '$_POST[date]' AND `Time` LIKE '$_POST[time]'");
#echo $result;
echo '<Table Border = 1 width=100%>';
if($_POST[current]=='checked')
{
echo '<tr><td>Log Number</td><td>Date</td><td>Time</td></td><td>Operator</td><td>Solution</td></tr>';
while($row = mysql_fetch_array($result))
  {

  echo '<tr><td><a href=index.php?p=hupdate&log='.$row['LogNumber'] .'>'.$row['LogNumber']. "</td><td>" . $row['Date'].'</td>'.'<td>'.$row['Time'].'</td><td>'.$row[Operator].'</td>'.'<td>'.$row[Solution].'</td></tr>';
  
  }
echo '</table>';
}
if($_POST[archive]=='checked')
{
echo '<p><h3>Archive Solutions Search<p></h3>';



$result =mysql_query("SELECT * FROM tblsolutionsarchive WHERE Solution LIKE '$_POST[s]' AND LogNumber LIKE '$_POST[lognumber]' AND Operator LIKE '$_POST[operator]' AND `Date` LIKE '$_POST[date]' AND `Time` LIKE '$_POST[time]'");
#echo $result;
echo '<Table Border = 1 width=100%>';
echo '<tr><td>Log Number</td><td>Date</td><td>Time</td></td><td>Operator</td><td>Solution</td></tr>';
while($row = mysql_fetch_array($result))
  {

  echo '<tr><td><a href=index.php?p=hupdatea&log='.$row['LogNumber'] .'>'.$row['LogNumber']. "</td><td>" . $row['Date'].'</td>'.'<td>'.$row['Time'].'</td><td>'.$row[Operator].'</td>'.'<td>'.$row[Solution].'</td></tr>';

  }
echo '</table>';
}
mysql_close();
?>